using System;
using System.Text;

// Logging
//#if LOG4NET
using log4net;
using log4net.Config;
using log4net.Core;
//#endif

namespace Icodeon.Scorm2CC
{

    #region Event Handler Delegates

    /// <summary>
    /// The 'Conversion Start' Event Handler Delegate
    /// </summary>
    /// <param name="sender">The Object that sent the Event</param>
    /// <param name="e">The 'Conversion Start' Event Argument</param>
    public delegate void ConversionStartEventHandler(object sender, ConversionStartEventArgs e);

    /// <summary>
    /// The 'Conversion Prpgress' Event Handler Delegate
    /// </summary>
    /// <param name="sender">The Object that sent the Event</param>
    /// <param name="e">The 'Conversion Prgoress' Event Argument</param>
    public delegate void ConversionProgressEventHandler(object sender, ConversionProgressEventArgs e);

    /// <summary>
    /// The 'Conversion Complete' Event Handler Delegate
    /// </summary>
    /// <param name="sender">The Object that sent the Event</param>
    /// <param name="e">The 'Conversion Complete' Event Argument</param>
    public delegate void ConversionCompleteEventHandler(object sender, ConversionCompleteEventArgs e);

    /// <summary>
    /// The 'Conversion Error' Event Handler Delegate
    /// </summary>
    /// <param name="sender">The Object that sent the Event</param>
    /// <param name="e">The 'Conversion Error' Event Argument</param>
    public delegate void ConversionErrorEventHandler(object sender, ConversionErrorEventArgs e);

    /// <summary>
    /// The 'Conversion Log' Event Handler Delegate
    /// </summary>
    /// <param name="sender">The Object that sent the Event</param>
    /// <param name="e">The 'Conversion Log' Event Argument</param>
    public delegate void ConversionLogEventHandler(object sender, ConversionLogEventArgs e);

    #endregion

    #region Event Arguments

    /// <summary>
    /// The 'Conversion Start' Event Argument
    /// </summary>
    public class ConversionStartEventArgs : EventArgs
    {
        public ConversionStartEventArgs()
        {
        }
    }

    /// <summary>
    /// The 'Conversion Progress' Event Argument
    /// </summary>
    public class ConversionProgressEventArgs : EventArgs
    {
        private int progressOverall;//0-100
        private string statusOverall;
        private int progressPackage;//0-100
        private string statusPackage;

        public ConversionProgressEventArgs(int progressOverall, string statusOverall, int progressPackage, string statusPackage)
        {
            this.progressOverall = progressOverall;
            this.statusOverall = statusOverall;
            this.progressPackage = progressPackage;
            this.statusPackage = statusPackage;
        }

        public int ProgressOverall { get { return this.progressOverall; } }
        public string StatusOverall { get { return this.statusOverall; } }
        public int ProgressPackage { get { return this.progressPackage; } }
        public string StatusPackage { get { return this.statusPackage; } }

    }

    /// <summary>
    /// The 'Conversion Complete' Event Argument
    /// </summary>
    public class ConversionCompleteEventArgs : EventArgs
    {
        private bool cancelled;

        public ConversionCompleteEventArgs(bool cancelled)
        {
            this.cancelled = cancelled;
        }

        public bool Cancelled { get { return this.cancelled; } }
    }

    /// <summary>
    /// The 'Conversion Error' Event Argument
    /// </summary>
    public class ConversionErrorEventArgs : EventArgs
    {
        private Exception exception;

        public ConversionErrorEventArgs(Exception exception)
        {

            this.exception = exception;
        }

        public Exception Exception { get { return this.exception; } }
    }

    /// <summary>
    /// The 'Conversion Error' Event Argument
    /// </summary>
    public class ConversionLogEventArgs : EventArgs
    {
        private Level logLevel;
        private string message;
        private Exception exception;

        public ConversionLogEventArgs(Level logLevel, string message, Exception exception)
        {
            this.logLevel = logLevel;
            this.message = message;
            this.exception = exception;
        }

        public Level LogLevel { get { return this.logLevel; } }
        public string Message { get { return this.message; } }
        public Exception Exception { get { return this.exception; } }
    }

    #endregion

}
